model2_cov<-lm(counter_sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(counter_sec3~treatment, data=data)
model3_cov<-lm(counter_sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model3)
summary(model3_cov)
multiplot(model1, model2, model3, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
multiplot(model1_cov, model2_cov, model3_cov, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
pdf("figures/figure7b.pdf", height=7, width=11)
multiplot(model1, model2, model3, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
dev.off()
#OLS Sectarian Ratings
model1<-lm(sec1~treatment, data=data)
model1_cov<-lm(sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(sec1~treatment, data=data)
model2_cov<-lm(sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(sec3~treatment, data=data)
model3_cov<-lm(sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model3)
summary(model3_cov)
pdf("figures/figure7a.pdf", height=7, width=11)
multiplot(model1, model2, model3, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
dev.off()
#OLS Combined Ratings
model1<-lm(combined1~treatment, data=data)
model1_cov<-lm(combined1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(combined1~treatment, data=data)
model2_cov<-lm(combined2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(combined3~treatment, data=data)
model3_cov<-lm(combined3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest+polfriends, data=data)
summary(model3)
summary(model3_cov)
pdf("figures/figure6.pdf", height=7, width=11)
multiplot(model1, model2, model3, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
dev.off()
stargazer(model1, model1_cov, model2, model2_cov, model3, model3_cov, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
stargazer(model1, model1_cov, model2, model2_cov, model3, model3_cov, ci = F, single.row = F, covariate.labels=c("Religious ID", "National ID", "Religious ID (Elite)", "National ID (Elite)"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
model1<-lm(combined1~treatment, data=data)
model1_cov<-lm(combined1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(combined1~treatment, data=data)
model2_cov<-lm(combined2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(combined3~treatment, data=data)
model3_cov<-lm(combined3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
stargazer(model1, model1_cov, model2, model2_cov, model3, model3_cov, ci = F, single.row = F, covariate.labels=c("Religious ID", "National ID", "Religious ID (Elite)", "National ID (Elite)", "Sectarianism Index", "Social Media Use", "Sectarian System Justification Index", "MCP", "Gender", "Education", "Religiosity", "Internet Use", "Political Interest"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
#OLS Sectarian Ratings
model1<-lm(sec1~treatment, data=data)
model1_cov<-lm(sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(sec1~treatment, data=data)
model2_cov<-lm(sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(sec3~treatment, data=data)
model3_cov<-lm(sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
model1<-lm(sec1~treatment, data=data)
model1_cov<-lm(sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(sec1~treatment, data=data)
model2_cov<-lm(sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(sec3~treatment, data=data)
model3_cov<-lm(sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
stargazer(model1, model1_cov, model2, model2_cov, model3, model3_cov, ci = F, single.row = F, covariate.labels=c("Religious ID", "National ID", "Religious ID (Elite)", "National ID (Elite)", "Sectarianism Index", "Social Media Use", "Sectarian System Justification Index", "MCP", "Gender", "Education", "Religiosity", "Internet Use", "Political Interest"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
model1<-lm(sec1~treatment, data=data)
model1_cov<-lm(sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(sec1~treatment, data=data)
model2_cov<-lm(sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(sec3~treatment, data=data)
model3_cov<-lm(sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
stargazer(model1, model1_cov, model2, model2_cov, model3, model3_cov, ci = F, single.row = F, covariate.labels=c("Religious ID", "National ID", "Religious ID (Elite)", "National ID (Elite)", "Sectarianism Index", "Social Media Use", "Sectarian System Justification Index", "MCP", "Gender", "Education", "Religiosity", "Internet Use", "Political Interest"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
#OLS Counter Sectarian Ratings
model1<-lm(counter_sec1~treatment, data=data)
model1_cov<-lm(counter_sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(counter_sec2~treatment, data=data)
model2_cov<-lm(counter_sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(counter_sec3~treatment, data=data)
model3_cov<-lm(counter_sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
stargazer(model1, model1_cov, model2, model2_cov, model3, model3_cov, ci = F, single.row = F, covariate.labels=c("Religious ID", "National ID", "Religious ID (Elite)", "National ID (Elite)", "Sectarianism Index", "Social Media Use", "Sectarian System Justification Index", "MCP", "Gender", "Education", "Religiosity", "Internet Use", "Political Interest"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
#Load Packages
library(readr)
library(ggplot2)
library(coefplot)
library(dplyr)
library(psych)
library(MASS)
library(xtable)
library(stargazer)
#Set Working Directory
setwd("..")
setwd("~/Dropbox/siegel_badaan_replication/")
#Read in Data
data<-read_csv("data/twitter_data.csv")
#Prepare data for analysis
#treatment variable
data$treatment_num<-as.factor(data$treatment_num)
#date variable
data$treatment_date<-as.Date(data$treatment_date, format="%m/%d/%y")
#median or fewer anti-Shia friends
data_anti_shia_net_low<-subset(data, data$anti_shia_friends_count<=38)
data_anti_shia_net_high<-subset(data, data$anti_shia_friends_count>38)
#subset data by follower counts
data_1000_fol<-subset(data, data$followers_count<=1000)
data_100_fol<-subset(data, data$followers_count<=100)
data_150_fol<-subset(data, data$followers_count<=150)
data_200_fol<-subset(data, data$followers_count<=200)
data_median_fol<-subset(data, data$followers_count<=245)
data_300_fol<-subset(data, data$followers_count<=300)
data_350_fol<-subset(data, data$followers_count<=350)
data_400_fol<-subset(data, data$followers_count<=400)
data_450_fol<-subset(data, data$followers_count<=450)
data_500_fol<-subset(data, data$followers_count<=500)
#suspended accounts
data$suspended<-ifelse(is.na(data$month_post), 1,0)
#proportion_variables
data$prop_pre_tpd<-data$tpd_anti_shia_pre/data$tpd_pre
data$prop_post_tpd<-data$tpd_anti_shia_post/data$tpd_post
data$prop_pre_week<-data$week_anti_shia_pre/data$week_pre
data$prop_post_week<-data$week_anti_shia_post/data$week_post
data$prop_pre_two_weeks<-data$two_weeks_anti_shia_pre/data$two_weeks_pre
data$prop_post_two_weeks<-data$two_weeks_anti_shia_post/data$two_weeks_post
data$prop_pre_month<-data$month_anti_shia_pre/data$month_pre
data$prop_post_month<-data$month_anti_shia_post/data$month_post
data[data=="Inf"]<-NA
data[data==Inf]<-NA
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data)
summary(day)
multiplot(day, week, two_weeks, month, coefficients=c("treatment_num1", "treatment_num2", "treatment_num3", "treatment_num4", "treatment_num5"),
newNames=c(treatment_num1="Arab ID ", treatment_num2="Religious ID ", treatment_num3="Arab ID (Elite)",
treatment_num4="Religious ID (Elite)", treatment_num5=" No ID "),
names=c("     Day", "   Week", "  Two Weeks ", "Month    "), title="", scales="free_x",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE,  zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen", "black")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=15))+
ylab("Treatments") + xlab("Difference in Anti-Shia Tweet Count")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
ticks<-seq(from=0, to=10000, by=500)
hist(data$followers_count, breaks=ticks, xaxt="n", xlab="Number of Followers", main="Distribution of Follower Counts", freq=TRUE, col="magenta")
(axis(1, at=ticks))
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(day)
vars<-c("month_anti_shia_pre","month_anti_shia_post", "month_pre", "month_post", "two_weeks_anti_shia_pre", "two_weeks_anti_shia_post", "two_weeks_pre", "two_weeks_post", "week_anti_shia_pre", "week_anti_shia_post", "week_pre", "week_post",
"tpd_anti_shia_pre", "tpd_anti_shia_post", "tpd_pre", "tpd_post", "followers_count")
des_stat<-data[vars]
des_stat$month_agg_anti_shia_pre<-des_stat$month_anti_shia_pre +des_stat$two_weeks_anti_shia_pre+ des_stat$week_anti_shia_pre + des_stat$tpd_anti_shia_pre
des_stat$month_agg_anti_shia_post<-des_stat$month_anti_shia_post +des_stat$two_weeks_anti_shia_post+ des_stat$week_anti_shia_post + des_stat$tpd_anti_shia_post
des_stat$month_agg_pre<-des_stat$month_pre +des_stat$two_weeks_pre+ des_stat$week_pre + des_stat$tpd_pre
des_stat$month_agg_post<-des_stat$month_post +des_stat$two_weeks_post+ des_stat$week_post + des_stat$tpd_post
des_stat<-as.data.frame(describe(des_stat))
des_stat<-des_stat[c("n", "mean", "median", "sd", "min", "max")]
rownames(des_stat)<-gsub("month_agg_anti_shia_pre", "Anti-Shia Pre-Treatment Tweet Count (Days 1-30)", rownames(des_stat))
rownames(des_stat)<-gsub("month_agg_anti_shia_post", "Anti-Shia Post-Treatment Tweet Count (Days 1-30)", rownames(des_stat))
rownames(des_stat)<-gsub("month_agg_pre", "Pre-Treatment Total Tweet Count (Days 1-30)", rownames(des_stat))
rownames(des_stat)<-gsub("month_agg_post", "Post-Treatment Total Tweet Count (Days 1-30)", rownames(des_stat))
rownames(des_stat)<-gsub("month_anti_shia_pre", "Anti-Shia Pre-Treatment Tweet Count (Days 15-30)", rownames(des_stat))
rownames(des_stat)<-gsub("month_anti_shia_post", "Anti-Shia Post-Treatment Tweet Count (Days 15-30)", rownames(des_stat))
rownames(des_stat)<-gsub("month_pre", "Pre-Treatment Total Tweet Count (Days 15-30)", rownames(des_stat))
rownames(des_stat)<-gsub("month_post", "Post-Treatment Total Tweet Count (Days 15-30)", rownames(des_stat))
rownames(des_stat)<-gsub("two_weeks_anti_shia_pre", "Anti-Shia Pre-Treatment Tweet Count (Days 8-14)", rownames(des_stat))
rownames(des_stat)<-gsub("two_weeks_anti_shia_post", "Anti-Shia Post-Treatment Tweet Count (Days 8-14)", rownames(des_stat))
rownames(des_stat)<-gsub("two_weeks_pre", "Pre-Treatment Total Tweet Count (Days 8-14)", rownames(des_stat))
rownames(des_stat)<-gsub("two_weeks_post", "Post-Treatment Total Tweet Count (Days 8-14)", rownames(des_stat))
rownames(des_stat)<-gsub("week_anti_shia_pre", "Anti-Shia Pre-Treatment Tweet Count (Days 2-7)", rownames(des_stat))
rownames(des_stat)<-gsub("week_anti_shia_post", "Anti-Shia Post-Treatment Tweet Count (Days 2-7)", rownames(des_stat))
rownames(des_stat)<-gsub("week_pre", "Pre-Treatment Total Tweet Count (Days 2-7)", rownames(des_stat))
rownames(des_stat)<-gsub("week_post", "Post-Treatment Total Tweet Count (Days 2-7)", rownames(des_stat))
rownames(des_stat)<-gsub("tpd_anti_shia_pre", "Anti-Shia Pre-Treatment Tweet Count (Day 1)", rownames(des_stat))
rownames(des_stat)<-gsub("tpd_anti_shia_post", "Anti-Shia Post-Treatment Tweet Count (Day1)", rownames(des_stat))
rownames(des_stat)<-gsub("tpd_pre", "Pre-Treatment Total Tweet Count (Day 1)", rownames(des_stat))
rownames(des_stat)<-gsub("tpd_post", "Post-Treatment Total Tweet Count (Day 1)", rownames(des_stat))
rownames(des_stat)<-gsub("followers_count", "Followers Count", rownames(des_stat))
xtable(des_stat)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
loc_table<-as.data.frame(table(data$loc_qual))
loc_table$Country<-loc_table$Var1
loc_table<-loc_table[c("Country", "Freq")]
loc_table<-loc_table[order(-loc_table$Freq),]
latex_table<-xtable(loc_table, row.names=F)
print(latex_table)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=filter(data, gcc==TRUE))
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=filter(data, gcc==TRUE))
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=filter(data, gcc==TRUE))
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=filter(data, gcc==TRUE))
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=filter(data, conflict==TRUE))
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=filter(data, conflict==TRUE))
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=filter(data, conflict==TRUE))
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=filter(data, conflict==TRUE))
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=filter(data, suspended==0))
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=filter(data, suspended==0))
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=filter(data, suspended==0))
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=filter(data, suspended==0))
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
data2<-data[c("month_anti_shia_post", "month_anti_shia_pre", "two_weeks_anti_shia_post", "two_weeks_anti_shia_pre", "week_anti_shia_post", "week_anti_shia_pre", "tpd_anti_shia_post", "tpd_anti_shia_pre", "treatment_num")]
data2[is.na(data2)] <- 0
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data2)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data2)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data2)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data2)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data_median_fol)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_low)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_low)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_low)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_low)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num, data=data_anti_shia_net_high)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
day<-glm.nb(tpd_anti_shia_post ~ treatment_num +tpd_anti_shia_pre, data = data, control=glm.control(maxit=50))
summary(day)
week<-glm.nb(week_anti_shia_post ~ treatment_num + week_anti_shia_pre, data = data, control=glm.control(maxit=50))
summary(week)
two_weeks<-glm.nb(two_weeks_anti_shia_post ~ treatment_num + two_weeks_anti_shia_pre, data = data, control=glm.control(maxit=50))
summary(two_weeks)
month<-glm.nb(month_anti_shia_post ~ treatment_num +month_anti_shia_pre, data = data, control=glm.control(maxit=50))
summary(month)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID",
"Arab ID (Elite)","Religious ID (Elite)","No ID",
"Anti-Shia Pre-Treatment Tweet Count (Day)","Anti-Shia Pre-Treatment Tweet Count (Week)",
"Anti-Shia Pre-Treatment Tweet Count (Two Weeks)", "Anti-Shia Pre-Treatment Tweet Count (Month)",
"Anti-Shia Pre-Treatment Tweet Count (Two Months)"))
month<-lm(prop_post_month-prop_pre_month ~ treatment_num, data=data)
summary(month)
two_weeks<-lm(prop_post_two_weeks-prop_pre_two_weeks ~ treatment_num, data=data)
summary(two_weeks)
week<-lm(prop_post_week-prop_pre_week ~ treatment_num, data=data)
summary(week)
day<-lm(prop_post_tpd-prop_pre_tpd ~ treatment_num, data=data)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"),star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"), notes="", notes.append=FALSE)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num + treatment_date, data=data)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num +treatment_date, data=data)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num +treatment_date, data=data)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num + treatment_date, data=data)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"), star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"))
data$treatment_date<-as.Date(data$treatment_date, format="%m/%d/%y")
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num + treatment_date, data=data)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num +treatment_date, data=data)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num +treatment_date, data=data)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num + treatment_date, data=data)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"), star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"))
data$treatment_date2<-as.character(data$treatment_date)
month<-lm(month_anti_shia_post-month_anti_shia_pre ~ treatment_num + treatment_date2, data=data)
summary(month)
two_weeks<-lm(two_weeks_anti_shia_post-two_weeks_anti_shia_pre ~ treatment_num +treatment_date2, data=data)
summary(two_weeks)
week<-lm(week_anti_shia_post-week_anti_shia_pre ~ treatment_num +treatment_date2, data=data)
summary(week)
day<-lm(tpd_anti_shia_post-tpd_anti_shia_pre ~ treatment_num + treatment_date2, data=data)
summary(day)
stargazer(day, week, two_weeks, month, ci = F, single.row = F, covariate.labels=c("Arab ID","Religious ID", "Arab ID (Elite)","Religious ID (Elite)","No ID"), star.cutoffs = c(.1, .05, .01, .001), star.char = c("dagger", "*", "**", "***"))
library(readr)
library(ggplot2)
library(coefplot)
library(stargazer)
library(dplyr)
#Set Working Directory
#setwd("..")
setwd("~/Dropbox/siegel_badaan_replication/")
#Read in Data
data<-read_csv("data/survey_data.csv")
#Covariate Indices (average responses)
data$relig<-(data$relig1+data$relig2+data$relig3+data$relig4+data$relig5+data$relig6+data$relig7+data$relig8+data$relig9+data$relig10+data$relig11+data$relig12)/12
data$sectarian<-(data$sectarian1+data$sectarian2+data$sectarian3+data$sectarian4+data$sectarian5)/5
data$sectsj<-(data$sectsj1+data$sectsj2+data$sectsj3+data$sectsj4+data$sectsj5+data$sectsj6+data$sectsj7+data$sectsj8)/8
data$mcp<-(data$mcp1+data$mcp2+data$mcp3+data$mcp4+data$mcp5+data$mcp6+data$mcp7+data$mcp8+data$mcp9+data$mcp10+data$mcp11)/11
#Sect Variables
data$maronite<-ifelse(data$Sect==1, 1,0)
data$sunni<-ifelse(data$Sect==7, 1,0)
data$shia<-ifelse(data$Sect==8, 1,0)
#Social Media Variables
socmedia
postfreq
internetuse
#Counter Sectarian Tweets
#rating
data$counter_sec1<-(data$Tweet8_1+data$Tweet6_1+data$Tweet4_1+data$Tweet7_1)/4
#person rating
data$counter_sec2<-(data$Tweet8_2+data$Tweet6_2+data$Tweet4_2+data$Tweet7_2)/4
#sharing likelihood
data$counter_sec3<-(data$Tweet8_3+data$Tweet6_3+data$Tweet4_3+data$Tweet7_3)/4
hist(data$counter_sec3)
#Sectarian Tweets
#rating
data$sec1<-(data$Tweet1_1+data$Tweet2_1+data$Tweet3_1+data$Tweet5_1)/4
#person rating
data$sec2<-(data$Tweet1_2+data$Tweet2_2+data$Tweet3_2+data$Tweet5_2)/4
#sharing likelihood
data$sec3<-(data$Tweet1_3+data$Tweet2_3+data$Tweet3_3+data$Tweet5_3)/4
#Counter Sectarian Ratings - Sectarian Ratings
data$combined1<-data$sec1-data$counter_sec1
data$combined2<-data$sec2-data$counter_sec2
data$combined3<-data$sec3-data$counter_sec3
#Treatment Var
data$treatment<-as.factor(data$Prmt)
#OLS Combined Ratings
model1<-lm(combined1~treatment, data=data)
model1_cov<-lm(combined1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(combined1~treatment, data=data)
model2_cov<-lm(combined2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(combined3~treatment, data=data)
model3_cov<-lm(combined3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
multiplot(model1, model2, model3, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
OLS Sectarian Ratings
model1<-lm(sec1~treatment, data=data)
model1_cov<-lm(sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(sec1~treatment, data=data)
model2_cov<-lm(sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(sec3~treatment, data=data)
model3_cov<-lm(sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
p
#OLS Sectarian Ratings
model1<-lm(sec1~treatment, data=data)
model1_cov<-lm(sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(sec1~treatment, data=data)
model2_cov<-lm(sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(sec3~treatment, data=data)
model3_cov<-lm(sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
multiplot(model1, model2, model3, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
#OLS Counter Sectarian Ratings
model1<-lm(counter_sec1~treatment, data=data)
model1_cov<-lm(counter_sec1~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model1)
summary(model1_cov)
model2<-lm(counter_sec2~treatment, data=data)
model2_cov<-lm(counter_sec2~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model2)
summary(model2_cov)
model3<-lm(counter_sec3~treatment, data=data)
model3_cov<-lm(counter_sec3~treatment +sectarian+ socmedia+sectsj+mcp+sex+EdLvl+relig+internetuse+polinterest, data=data)
summary(model3)
summary(model3_cov)
multiplot(model1, model2, model3, coefficients=c("treatment2", "treatment3", "treatment4", "treatment5"),
newNames=c(treatment2="Religious ID", treatment3="National ID ", treatment4="Religious ID (Elite)",
treatment5="National ID (Elite)"),
names=c(" Tweet Rating", " User Rating", "Likely to Share"), title="",
sort="alphabetical", innerCI=1.645, outerCI=1.96, single=FALSE, zeroType = 0,legend.position="none") +
scale_color_manual(values=c("red", "blue", "seagreen")) +
theme_bw() + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), legend.position="none", axis.line = element_line(colour = "black"), text = element_text(size=16))+
ylab("Treatments") + xlab("OLS Estimates")+ geom_vline(aes(xintercept = 0), size = .5, linetype = "dashed")
